<? $this->headTitle($this->shopName . ' - ' . $this->translate($this->shopTitle)); ?>
<? $this->headMeta()->appendName('keywords', $this->translate('online store') . ', ' . mb_strtolower($this->translate($this->shopCity), 'utf8') . ', ' . $this->translate('TVs, audio, video, cameras, computers, components')); ?>
<? $this->headMeta()->appendName('description', $this->translate($this->shopTitle) . '. ' . $this->translate('TVs, audio, video, cameras, computers, components') . ' ' . $this->translate('and other.') . ' ' . $this->translate('Sale, shipment, warranty.')); ?>
<? $this->headLink()->appendStylesheet('/css/index.css'); ?>

<? if ($this->categoryTree && $this->categoryTree->children) : ?>
    <div class="categories">
        <? $categoriesCount = 0;
        $categoryIndex = 0; ?>
        <div class="categories-column">
            <? while ($categoriesCount < $this->categoriesCount / 3) : ?>
                <div class="category">
                    <? $category = $this->categoryTree->children[$categoryIndex++]; ?>
                    <a href="/<?= $this->language ?>/catalog/<?= $category->id ?>">
                        <?= $this->escape($category->name) ?></a>
                    <? if ($category->children) : ?>
                        <div class="subcategories">
                            <? foreach ($category->children as $subCategory) : ?>
                                    <a href="/<?= $this->language ?>/catalog/<?= $subCategory->id ?>">
                                        <img src="<?= $subCategory->thumb_pic ?>"/>
                                        <span><?= $this->escape($subCategory->name) ?></span>
                                    </a>
                                <? $categoriesCount++ ?>
                            <? endforeach; ?>
                        </div>
                    <? endif; ?>
                    <? $categoriesCount++ ?>
                </div>
            <? endwhile; ?>
        </div>
        <div class="categories-column">
            <? while ($categoriesCount < $this->categoriesCount / 3 * 2 + 1) : ?>
                <div class="category">
                    <? $category = $this->categoryTree->children[$categoryIndex++]; ?>
                    <a href="/<?= $this->language ?>/catalog/<?= $category->id ?>">
                        <?= $this->escape($category->name) ?></a>
                    <? if ($category->children) : ?>
                        <div class="subcategories">
                            <? foreach ($category->children as $subCategory) : ?>
                                    <a href="/<?= $this->language ?>/catalog/<?= $subCategory->id ?>">
                                        <img src="<?= $subCategory->thumb_pic ?>"/>
                                        <span><?= $this->escape($subCategory->name) ?></span>
                                    </a>
                                <? $categoriesCount++ ?>
                            <? endforeach; ?>
                        </div>
                    <? endif; ?>
                    <? $categoriesCount++ ?>
                </div>
            <? endwhile; ?>
        </div>
        <div class="categories-column">
            <? while ($categoriesCount < $this->categoriesCount) : ?>
                <div class="category">
                    <? $category = $this->categoryTree->children[$categoryIndex++]; ?>
                    <a href="/<?= $this->language ?>/catalog/<?= $category->id ?>">
                        <?= $this->escape($category->name) ?></a>
                    <? if ($category->children) : ?>
                        <div class="subcategories">
                            <? foreach ($category->children as $subCategory) : ?>
                                    <a href="/<?= $this->language ?>/catalog/<?= $subCategory->id ?>">
                                        <img src="<?= $subCategory->thumb_pic ?>"/>
                                        <span><?= $this->escape($subCategory->name) ?></span>
                                    </a>
                                <? $categoriesCount++ ?>
                            <? endforeach; ?>
                        </div>
                    <? endif; ?>
                    <? $categoriesCount++ ?>
                </div>
            <? endwhile; ?>
        </div>
    </div>
<? endif ?>

